<template>
	<div class="input-check">
		<el-input
			v-model="dataValue.text"
			:placeholder="placeholder"
			:type="type"
			:showPassword="type == 'password'"
			:disabled="disabled"
			@input="_valueChange"
			:autocomplete="type == 'password' ? 'new-password' : 'off'"
		></el-input>
		<el-checkbox v-model="dataValue.check" @change="_valueChange">{{
			item.checkLabel
		}}</el-checkbox>
	</div>
</template>
<script type="text/javascript">
import objMixin from './objMixin'
import { bounceFun } from '@/utils'
export default {
	name: 'xh-input', // 新建 input
	mixins: [objMixin],
	inject: {
		createFields: {
			default: null
		},
		XhForm: {
			default: null
		}
	},
	data() {
		return {
			dataValue: {
				text: '',
				check: !1
			}
		}
	},
	computed: {
		placeholder() {
			var { placeholder } = this.item || {}
			return placeholder || '请输入'
		}
	},
	methods: {
		_valueChange(val) {
			this.valueChange(this.dataValue)
		}
	},
	mounted() {
		setTimeout(() => {
			console.log(this.dataValue)
		}, 1000)
	}
}
</script>
<style lang="scss" scoped>
.el-input {
	display: block;
}
.input-check {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 5px;
	align-items: center;
	justify-items: stretch;
}
</style>
